<template>
	<div class="col-main">
		<div class="generate-img">
			<div>
				<el-button class="generate-btn" round @click="cyImgList">生成图片</el-button>
			</div>
			<img :src="cyUrl" alt="" />
		</div>
	</div>
</template>

<script setup>
	// https://apii.ctose.cn/api/cy/api/
	import axios from 'axios';
	import { reactive, toRefs, onMounted } from 'vue';
	const data = reactive({
		cyUrl: '',
	})
	const { 
		cyUrl
	} = toRefs(data);
	onMounted(() => {
		
	})
	// 初音图片生成
	function cyImgList() {
		axios({
		    method:"GET",
		    url: 'https://apii.ctose.cn/api/cy/api/',
		    data: {},
		    headers: {
		        'Content-Type': 'application/json',
		    }
		})
		.then(res => {
		    // console.log(res)
			data.cyUrl = res.request.responseURL;
		})
		.catch(error => {
		    console.error("There was an error!", error);
		});
	}
</script>

<style>
</style>